package com.apestech.api.condition.conlib;

import com.apestech.framework.db.SqlSession;
import com.apestech.framework.util.StringUtil;
import com.apestech.framework.xml.condition.modul.Condition;
import com.apestech.framework.xml.table.modul.Tables;

import java.util.ArrayList;

public class ConPub extends StringUtil {
    private Condition condition;
    private SqlSession session;
    private String mid;
    private String tabName;
    private ArrayList<Tables> tables;
    private int tableSize;

    public ConPub(Condition condition) throws Exception {
        this.condition = condition;
        this.session = condition.getSession();
        tables = condition.getTables();
        tableSize = tables.size();
    }

    public String getMid() {
        return mid;
    }

    public void setMid(String mid) {
        tabName=condition.getTableKey().getTabName(mid);
        this.mid = mid;
    }

    public String getTabName() {
        return tabName;
    }

    public int getTableSize() {
        return tableSize;
    }

    public Condition getCondition() {
        return condition;
    }

    public SqlSession getSession() {
        return session;
    }

    public ArrayList<Tables> getTables() {
        return tables;
    }
}
